module.exports = {
    /*
     ** Headers of the page
     */
    head: {
        title: 'starter',
        meta: [
            {charset: 'utf-8'},
            {name: 'viewport', content: 'width=device-width, initial-scale=1'},
            {hid: 'description', name: 'description', content: ''}
        ],
        link: [
            {rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'}
        ],
        script: [],
    },
    /*
     ** Global CSS
     */
    css: [
        '~assets/css/style.css',
        //   {src: '~/assets/scss/element-variables.scss', lang: 'scss'},
        'element-ui/lib/theme-chalk/index.css'
        // {src: '~/assets/less/index.less', lang: 'less'},
    ],
    router: {
        middleware: ['auth', 'dict']
    },
    plugins: [
        {src: '~plugins/element-ui', ssr: true},
        {src: '~plugins/filters', ssr: false}
    ],
    /*
     ** Add axios globally
     */
    build: {
        vendor: ['axios', 'element-ui'],
        /*
         ** Run ESLINT on save
         */
        extend(config, ctx) {
            if (ctx.isClient) {
                config.module.rules.push({
                    enforce: 'pre',
                    test: /\.(js|vue)$/,
                    loader: 'eslint-loader',
                    exclude: /(node_modules)/
                })
            }
        }
    },
    env: {
        host: process.env.HOST || '127.0.0.1', // 服务主域
        port: process.env.PORT || 3000, // 服务端口
        proxyUrl: 'localhost:8080', // 代理服务url
        apiPrefix: '/api'// 接口访问前缀
    }
};
